<#include "/common/defaultEngine.html"/>
<@pageTheme mark="${config.optimize()?string('true', 'false')}">
<@header title="新增采购订单" bodyClass="white-bg" libs=["prism","bootstrapSelect","ueditor"]/>
<div class="wrapper wrapper-content ibox-content">
    <@form.form id="form-purchase-add"  class="form-horizontal">
    <input  type="hidden" name="userId" value="${user.id}">
    <input  type="hidden" name="saleUserid" value="${user.id}">
    <input  type="hidden" name="modelKey" value="${bpmTaskFrom.modelKey}">
    <input  type="hidden" name="taskId" value="${taskEntity.taskId}">
    <input  type="hidden" name="isWai" value="1">
    <input name="fromName"  value="${bpmTaskFrom.fromName}" type="hidden">
    <input name="processInstanceId" value="${taskEntity.processInstanceId}" type="hidden">
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售员"/>：
       </label>
        <div class="col-sm-8"><input name="saleUserName" value="${user.name}" class="form-control" type="text"  readonly="true">
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "销售订单编号"/>：
       </label>
        <div class="col-sm-8"><input name="saleOrderNumber" value="${saleOrderNumber}" class="form-control" type="text" readonly="true" >
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><@ctx.i18n text = "合同价格"/>：
       </label>
        <div class="col-sm-8"><input name="orderContractPrice" class="form-control" type="text" readonly="true" >
        </div>
     </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否含税"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="orderIsTax" dictType="sys_crm_isOrNo" />
</div>
</div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否包含运输费用"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="orderIsTransport" dictType="sys_crm_isOrNo" />
    </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否保修"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="orderIsGuarantee" dictType="sys_crm_isOrNo" />
    </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "其他"/>：
       </label>
        <div class="col-sm-8"><input name="orderOtherItem" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车辆识别号"/>：
       </label>
        <div class="col-sm-8"><input name="carVin" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车辆"/>：
       </label>
        <div class="col-sm-8"><input name="carVehicle" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "里程"/>：
       </label>
        <div class="col-sm-8"><input name="carMileage" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "变速箱 "/>：</label>
        <div class="col-sm-8">
              <@form.radio name="carTranmission" dictType="sys_crm_cartranmission" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "驱动形式"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="carDrivertrain" dictType="sys_crm_cardrivertrain" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "车况"/>：</label>
        <div class="col-sm-8">
            <@form.select name="carStatus" dictType="sys_crm_carstatus" required="true" />
        </div>
    </div>
    <div class="form-group">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "最高价"/>：
       </label>
        <div class="col-sm-8"><input name="channelHighestPrice" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购来源"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="channelPurchaseSource" dictType="sys_crm_purchasesource" />
        </div>
    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "是否公开销售"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="channelIsOpenSale" dictType="sys_crm_isOrNo" />
        </div>
    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖 "/>：</label>
        <div class="col-sm-8">
            <@form.select name="channelAuction" dictType="sys_auction" required="true" />
        </div>
    </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖类型"/>：</label>
        <div class="col-sm-8">
              <@form.radio name="channelAuctionType" dictType="sys_crm_auctiontype" />
        </div>
    </div>
    <div class="form-group auctionClass">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖时间类型"/>：
       </label>
        <div class="col-sm-8"><input name="channelAuctionTimeType" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group auctionClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "拍卖时间"/>：</label>
        <div class="col-sm-8">
            <div class="input-group date">
                <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                <input class="form-control time-input" name="channelAuctionTime"  data-type="date" data-format="yyyy-MM-dd" type="text"  required/>
            </div>
        </div>
    </div>
    <div class="form-group otherClass">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "卖方名称"/>：
       </label>
        <div class="col-sm-8"><input name="channelSellerName" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group otherClass">        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "卖方联系方式"/>：
       </label>
        <div class="col-sm-8"><input name="channelSellerContactinfo" class="form-control" type="text"  required>
        </div>
     </div>
    <div class="form-group otherClass">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "采购备注"/>：</label>
        <div class="col-sm-8">
            <textarea name="channelPurchaseMemo" class="form-control" required></textarea>
        </div>
    </div>
    <h4 class="form-header h4"><@ctx.i18n text = "流程设置"/></h4>
    <div class="form-group">
        <label class="col-sm-3 control-label"><span style="color: red; ">*</span><@ctx.i18n text = "审批人"/>：</label>
        <div class="col-sm-8">
            <@form.select name="flowNextReviewerAssignee" items=userInfo itemLabel="name" itemValue="id" required="true"/>
        </div>
    </div>
</@form.form>
</div>
<@footer>
    <script type="text/javascript">
        var prefix = baseURL + "bpm/purchase"
        $("#form-purchase-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if (opt.validate.form()) {
                opt.operate.save(prefix + "/add", $('#form-purchase-add').serialize());
            }
        }
        /**
         * redio 单选回调
         * @param id
         * @param data
         * @param event
         */
        function  redioCallback(id,data,event){
            if(id == "channelPurchaseSource"){
                if ($(data).is(':checked')){
                    var menuType = $(event.target).val();
                    if(menuType=="0"){
                        $(".auctionClass").show();
                        $(".otherClass").hide();
                    }
                    else if(menuType=="1"||menuType=="2"||menuType=="3"){
                        $(".auctionClass").hide();
                        $(".otherClass").show();
                    }
                }
            }
        }
</script>
</@footer>
</@pageTheme>